package task3;

/**
 * 测试类
 */
public class test {
    public static void main(String[] args) {
        // 1.定义一个传参类型的电话卡
        PhoneCard phoneCard = new PhoneCard(PhoneCardType.BIG,"13687378850","赵四","12345",100.0,0.0,0.0);
        phoneCard.show();
        System.out.println("------------------------------------");
        // 2.定义一个传参类型的通话套餐
        Package phonePackage = new PhonePackage(60.0,50.0,20);
        // 显示当前通话套餐信息
        phonePackage.show();
        System.out.println("------------------------------------");
        // 3.定义一个传参类型的上网套餐
        Package netPackage = new NetPackage(30.0,50.0);
        // 显示当前上网套餐信息
        netPackage.show();
        System.out.println("------------------------------------");
        // 4.定义用户消费行为
        UserConsume userConsume = new UserConsume();
        // 5.将定义的通话套餐、流量套餐绑定到电话卡上，并开始计费
        phonePackage.addPackage(phoneCard,userConsume);
        netPackage.addPackage(phoneCard,userConsume);
        phoneCard.show();
        System.out.println("------------------------------------");
        // 6.用户进行通话，定义通话时间
        double user_time = 10.0;
        phonePackage.consume(phoneCard,userConsume,user_time);
        // 7.用户进行上网，定义上网流量
        double user_data = 10.0;
        netPackage.consume(phoneCard,userConsume,user_data);
        phoneCard.show();
    }
}
